home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr49 / 119_01.zip / BIOSMEMR.ASM < prev    next >
Assembly Source File  |  1993-06-16  |  2KB  |  84 lines

  1. conino:    call    test    ;a<--- iconin (console input character)
  2. conin:    in     cstat    ;a<--- console status
  3.     ani    imask
  4.     jz    conino    ;jump to memory test if no character ready
  5.     in     cdata    ; get character into A
  6.     ani    7fh    ; mask parity bit out
  7.     ret
  8.  
  9. ; *****************************************************************************
  10. ; This is the memory test routine that gets called if the computer is         *
  11. ; idle, that is, waiting for character input from the console.                *
  12. ; Taken from Lifelines Volume I No. 12 (May 1981)                             *
  13. ; Patched in by Barry A. Dobyns, 12 June 1981                                 *
  14. ; *****************************************************************************
  15.  
  16. test:    push     h
  17.     lhld    tstpt    ;HL = test address
  18.     inx     h    ;HL++
  19.     mov    a,h
  20.     cpi    $/100h
  21.     jnz    test1    ; jump if below current location
  22.     lxi    h,0    ; re-initialize test pointer
  23. test1:    shld    tstpt    ; increment memory pointer
  24.     mov    a,m    ; test memory @ tstpt
  25.     cma
  26.     mov     m,a
  27.     cmp     m
  28.     jz     test2    ;jump if memory ok at tstpt
  29.     xra    m    ;a = bad bits
  30.     push     psw
  31.     call     prtstr
  32.     db    cr,lf,'*** ',0
  33.     pop    psw    ;a = bad bits (still)
  34.     push     psw
  35.     call    prthx    ;display bad bits
  36.     call    prtstr
  37.     db    ' Bits BAD at: ',0
  38.     mov    a,h
  39.     call    prthx   ;display bad address
  40.     mov    a,l
  41.     call    prthx
  42.     pop     psw
  43. test2:  cma
  44.     mov    m,a
  45.     pop    h
  46.     ret
  47.  
  48. prthx:  push    psw     ;prthx (print a-reg in hex)
  49.     rrc
  50.     rrc
  51.     rrc
  52.     rrc
  53.     call     prthx1    ;print most significant nibble
  54.     pop    psw
  55. prthx1: ani    0fh
  56.     cpi    10
  57.     jc    prthx2
  58.     adi    7
  59. prthx2: adi    '0'    ;(zero)
  60.  
  61. output: push    b
  62.     mov    c,a
  63.     call    conout    ;output char to console
  64.     pop    b
  65.     ret
  66.  
  67. prtstr:    xthl        ;print chars in string following call
  68.     push    psw    ;to prtstr    
  69.     call    prt
  70.     pop    psw
  71.     xthl
  72.     ret
  73. prt:    mov    a,m
  74.     inx    h
  75.     ana    a
  76.     rz
  77.     call    output    ;output char
  78.     jmp    prt
  79.  
  80. tstpt:    dw    0    ;current address of test point 
  81.  
  82.     
  83.     current location
  84.     lxi    h,0    ; re-initialize test pointer